<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // let hd = 2?2:5;
        // console.log(hd); // 2

        let hd = 2 ? (3 ? "a" : "b") : 5; // a

        function div(options={}){
            let div = document.createElement('div');
            div.style.width = options.width?options.width:'100px';
            div.style.height = options.height?options.height:'100px';
            div.style.backgroundColor = options.backgroundColor?options.backgroundColor:'red';
            document.body.appendChild(div);
        }
        
        div({width:'200px',height:'20px',backgroundColor:'blue'});
    </script>
</body>

</html>